// app.js
const express = require('express');
const userRoutes = require('./routes/userRoutes');
const taskRoutes = require('./routes/taskRoutes');
const bodyParser = require('body-parser');
const cors = require('cors');

const app = express();
const port = 3000;

app.use(bodyParser.json());
app.use('/user', userRoutes);
app.use('/task', taskRoutes);
app.use(cors());

app.listen(port, () => {
    console.log(`Server running on http://localhost:${port}`);
});